#include <tuple>

using namespace std;

template <typename T>
struct Node
{
    T element;
    Node<T> *prev, *next;
};

template <typename T>
class Queue
{
public:
    Queue(int capacity);
    virtual ~Queue(){};
    void Clear();
    bool IsEmpty() const;
    bool IsFull() const;
    int Len() const;
    bool EnQueue(T element);
    tuple<bool, T> DeQueue();

private:
    Node<T> *head, *tail;
    int len, cap;
};
